package com.tosh;

import com.tosh.model.Company;
import com.tosh.model.Factor;
import com.tosh.model.Match;
import com.tosh.model.Topic;

import java.util.List;
import java.util.logging.Logger;

/**
 * User: arsentyev
 * Date: 04.10.12
 */
public class MainSoup {
    protected final static Logger _log = Logger.getLogger(MainSoup.class.getName());

    public static void main(String... args) {
        List<Match> matches = null;
        for(Company company : Company.values()) {
            System.out.println("------------------------------------------------------------");
            System.out.print("-------------  Company : ");
            System.out.printf("%-10s", company.name());
            System.out.println("  -----------------------");
            System.out.println("------------------------------------------------------------");
            System.out.println();
            System.out.println();

            for(Topic topic : Topic.values()) {
                matches = company.getMatches(topic);

                if(!matches.isEmpty()) {
                    System.out.println("-----------Topic : " + topic.name() + "  -------------");
                }
                for(Match m: matches) {
                    System.out.println("Teams = " + m.getMember1() + " - " + m.getMember2());
                    System.out.println();
                    System.out.println("Factors: " + m.getFactor(Factor.WIN1) + " / " + m.getFactor(Factor.DRAW) + " / " + m.getFactor(Factor.WIN2));
                    System.out.println();
                }

//                for(Match m: matches) {
//                    System.out.println("Team 1 = " + m.getMember1());
//                    System.out.println("Team 2 = " + m.getMember2());
//                    System.out.println();
//                    System.out.println("Factors:");
//                    for(Factor fac: Factor.values()) {
//                        System.out.printf("%-9s", fac.name());
//                        System.out.println(" =  " + m.getFactor(fac));
//                    }
//                    System.out.println();
//                    System.out.println();
//                }
            }
        }
    }
}